import me.dqn.aspect.ProxyAspect;
import me.dqn.proccesor.ProcessJoinPoint;

/**
 * created by dqn
 * 2018/5/12--13:24
 * 继承切面抽象类
 */
public class MyAspect extends ProxyAspect {

    /**
     * 重写 doAround 方法
     * @param processJoinPoint 被传进来的原来的信息
     * @return
     */
    @Override
    public Object doAround(ProcessJoinPoint processJoinPoint) {
        System.out.println("before around target");
        try {
            String a = (String) processJoinPoint.process();
            a = a + " -> 经过一些处理";
            System.out.println("after around target");
            return a;
        } catch (Throwable throwable) {
            throwable.printStackTrace();
            return null;
        }
    }
}
